﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Data {
   
    public partial class TokenBillMap
    : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<TokenBill> {
        public TokenBillMap() {
            ToTable("mc_TokenBill", "dbo");

            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            HasRequired(t => t.Merchant)
             .WithMany()
             .HasForeignKey(d => d.MerchantId)
             .WillCascadeOnDelete(false);
            HasRequired(t => t.ApplyMerchant)
          .WithMany()
          .HasForeignKey(d => d.ApplyMerchantId)
          .WillCascadeOnDelete(false);
        }
    }
}
